<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <script type="text/javascript" src="/js/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" src="/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/css/bootstrap.min.css" />
    <link rel="stylesheet" href="/css/my-css.css" />
    <script type="text/javascript" src="/js/my-js.js" ></script>
    <script type="text/javascript" src="/js/jquery.cookie.js" ></script>
    <script type="text/javascript" src="/js/vue.min.js" ></script>
    <title>Java学习网</title>
</head>
<body>
    <div id="header"></div>
    <script type="text/javascript">moralLoad("#header", "/html/header.html")</script>
    <div class="container">
        <div class="row" id="app" v-cloak>
            <div class="col-xs-offset-1 col-xs-10 panel panel-default">
                <h3><b>搜索结果</b></h3><hr/>
                <a v-for="result in results" class="panel panel-default" v-bind:href="result.url" target="_blank">
                    <div class="panel-heading">
                      <h3 class="panel-title" v-text="result.typeName + ' - ' + result.title"></h3>
                    </div>
                    <div class="panel-body"><p v-text="result.description"></p></div>
                </a>
            </div>
        </div>
    </div>
</body>
<script type="text/javascript">
    var results;
    myAjax({
        type: 'get',
        url: '/resources?keyword=' + $.cookie("keyword"),
        async: false,
        success: function(data) {
            results=data;
            $.removeCookie("keyword");
        }
    });
    new Vue({
      el: "#app",
      data: {
        results: results
      }
    });
</script>
</html>